#ifndef VSMODELMESHNODE_H
#define VSMODELMESHNODE_H
#include "VSMeshNode.h"
#include "VSGeometryNode.h"
namespace VSEngine2
{
	class VSGeometryNode;
	class VSSwitchNode;
	class VSStream;
	class VSGRAPHIC_API VSModelMeshNode : public VSMeshNode
	{
		//PRIORITY
		
		//RTTI
		DECLARE_RTTI;
		DECLARE_INITIAL
	public:
		enum	//LOD TYPE
		{
			LT_NONE,
			LT_DLOD,
			LT_CLOD,
			LT_MAX
		};
		VSModelMeshNode();
		virtual ~VSModelMeshNode();

		virtual unsigned int GetST(){return ST_MESH_NODE;}
		inline unsigned int GetLodType()const{return m_uiLodType;}
		inline void SetLodType(unsigned int uiLodType)
		{
			if (uiLodType >= LT_MAX)
			{
				return;
			}
			m_uiLodType = uiLodType;
		}


		virtual void CreateClodMesh();
		virtual bool SetLodDesirePercent(VSREAL fDesirePercent);

		virtual VSSwitchNode * GetDlodNode()const;
		virtual unsigned int GetResourceType()const
		{
			return RT_MAX;
		}
		virtual VSGeometryNode * GetGeometryNode(unsigned int uiLodLevel);
	public:
		
		virtual unsigned int DiskUse()const;

		virtual bool Save(VSStream & rStream,unsigned int &iSaveUse)const;
		virtual bool Load(VSStream & rStream,unsigned int &iSaveUse);
	protected:

		unsigned int m_uiLodType;
	public:
		virtual bool Clone(const VSObject *pObject,unsigned int uiType);
	};
	DECLARE_Ptr(VSModelMeshNode);
	VSTYPE_MARCO(VSModelMeshNode);
}
#endif